/* 基础样式文件 - 专业版选股系统基础样式 */

/* ============================================================================ 
   全局重置和基础样式
   ============================================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

/* ============================================================================ 
   基础布局结构
   ============================================================================ */

.app-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
    width: 100%;
}

/* 标签页内容布局 */
.tab-content {
    display: grid;
    grid-template-columns: minmax(350px, 400px) 1fr;
    gap: 15px;
    width: 100%;
    box-sizing: border-box;
    align-items: stretch;
    min-height: 500px;
}

/* 收益分析页面特定的tab-content样式 */
.performance-tab-content {
    display: grid;
    grid-template-columns: minmax(350px, 400px) 1fr;
    gap: 25px;
    width: 100%;
    box-sizing: border-box;
    align-items: stretch;
    min-height: 600px;
}

/* 收益分析页面布局调试和优化 */
.performance-tab-content > * {
    min-height: 0;
}

.performance-tab-content .performance-control-panel {
    grid-column: 1;
    grid-row: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.performance-tab-content .performance-results-panel {
    grid-column: 2;
    grid-row: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* 面板基础样式 */
.panel {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.panel:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.panel-title {
    font-size: 1.25em;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 控制面板样式 */
.control-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 350px;
    max-width: 400px;
    height: 100%;
}

/* 结果面板统一样式 */
.results-panel {
    width: 100%;
    grid-column: 1 / -1;
}

/* 数据分析面板样式 */
.analytics-panel {
    grid-column: 1 / -1;
    width: 100%;
}

/* ============================================================================ 
   头部区域布局
   ============================================================================ */

.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 15px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
}

.header h1 {
    font-size: 2.5em;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
    font-weight: 700;
}

.header p {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 20px;
}

/* 头部导航 */
.header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.header-nav h1 {
    margin: 0;
}

.header-nav-links {
    display: flex;
    gap: 10px;
}

.header-nav-link {
    text-decoration: none;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 10px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.header-nav-link.performance {
    color: #28a745;
    border: 2px solid #28a745;
}

.header-nav-link.performance:hover {
    background: #28a745;
    color: white;
    transform: translateY(-2px);
}

.header-nav-link.import {
    color: #17a2b8;
    border: 2px solid #17a2b8;
}

.header-nav-link.import:hover {
    background: #17a2b8;
    color: white;
    transform: translateY(-2px);
}

.header-nav-link.news {
    color: #ff6b35;
    border: 2px solid #ff6b35;
}

.header-nav-link.news:hover {
    background: #ff6b35;
    color: white;
    transform: translateY(-2px);
}

.header-nav-link.limit-up {
    color: #e74c3c;
    border: 2px solid #e74c3c;
}

.header-nav-link.limit-up:hover {
    background: #e74c3c;
    color: white;
    transform: translateY(-2px);
}

.header-nav-link.consecutive {
    color: #f39c12;
    border: 2px solid #f39c12;
}

.header-nav-link.consecutive:hover {
    background: #f39c12;
    color: white;
    transform: translateY(-2px);
}



.header-nav-link.fundamental {
    color: #9b59b6;
    border: 2px solid #9b59b6;
}

.header-nav-link.fundamental:hover {
    background: #9b59b6;
    color: white;
    transform: translateY(-2px);
}

.header-nav-link.daily-review {
    color: #3498db;
    border: 2px solid #3498db;
}

.header-nav-link.daily-review:hover {
    background: #3498db;
    color: white;
    transform: translateY(-2px);
}

/* 子菜单样式 */
.nav-item {
    position: relative;
}

.nav-item.has-submenu .header-nav-link {
    position: relative;
}

.submenu-arrow {
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.header-nav-link.submenu-open .submenu-arrow {
    transform: rotate(180deg);
}

.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 180px;
    z-index: 1000;
    display: none;
    padding: 8px 0;
    border: 1px solid rgba(0,0,0,0.1);
}

.submenu-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.submenu-link:hover {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.submenu-link.active {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
    font-weight: 600;
}

/* 子菜单项特定样式 */
.submenu-link.limit-up {
    color: #e74c3c;
}

.submenu-link.limit-up:hover,
.submenu-link.limit-up.active {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.submenu-link.consecutive {
    color: #f39c12;
}

.submenu-link.consecutive:hover,
.submenu-link.consecutive.active {
    background: rgba(243, 156, 18, 0.1);
    color: #f39c12;
}


    color: #e67e22;
}



/* 响应式子菜单 */
@media (max-width: 768px) {
    .submenu {
        position: static;
        box-shadow: none;
        border: none;
        background: rgba(255,255,255,0.1);
        margin-top: 5px;
        border-radius: 8px;
    }
    
    .submenu-link {
        padding: 8px 12px;
        font-size: 0.9em;
    }
    
    .nav-item.has-submenu .header-nav-link {
        justify-content: space-between;
    }
}



.stats-section { 
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    height: fit-content;
    transition: all 0.3s ease;
}

.stats-title { 
    font-size: 18px; 
    font-weight: 700; 
    color: #333; 
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-item { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 12px 16px; 
    margin-bottom: 8px; 
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.stats-label { 
    font-weight: 600; 
    color: #495057; 
    font-size: 14px;
}

.stats-value { 
    font-weight: 700; 
    color: #e67e22; 
    font-size: 16px;
}

.data-section { 
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.data-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 20px; 
    padding-bottom: 15px; 
    border-bottom: 2px solid #e9ecef; 
}

.data-title { 
    font-size: 20px; 
    font-weight: 700; 
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.data-controls { 
    display: flex; 
    gap: 10px; 
    align-items: center; 
}

.filter-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: white;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.data-table th {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    border: none;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
    vertical-align: middle;
}

.data-table tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

.stock-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stock-code {
    font-weight: 700;
    color: #495057;
    font-size: 14px;
}

.stock-name {
    color: #6c757d;
    font-size: 12px;
}

.amount {
    font-weight: 600;
    color: #28a745;
}

.amount.negative {
    color: #dc3545;
}

.percent {
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
}

.percent.positive {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.percent.negative {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 1200px) {
    
        grid-template-columns: 1fr;
    }
    
    .stats-section {
        order: 2;
    }
    
    .data-section {
        order: 1;
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: 10px;
    }
    
    .data-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 6px;
    }
}

/* 头部统计信息 */
.header-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.stat-number {
    font-size: 1.8em;
    font-weight: bold;
    color: #667eea;
}

.stat-label {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
}

/* ============================================================================ 
   导航标签栏
   ============================================================================ */

.nav-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 5px;
    margin-bottom: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.nav-tab {
    flex: 1;
    padding: 12px 20px;
    text-align: center;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.nav-tab.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.nav-tab:hover:not(.active) {
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

/* ============================================================================ 
   动画效果
   ============================================================================ */

.tab-content-active {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
